<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<include file="./Home/Tpl/Admin/Common/cssjs.html" />
<link rel="stylesheet" type="text/css" href="{$Config.siteurl}statics/js/ueditor/themes/default/ueditor.css"/>
<script type="text/javascript">
$(document).ready(function() {
	$.formValidator.initConfig({autotip:true,formid:"myform",onerror:function(msg){}});
	$("#name").formValidator({onshow:"请输入链接名称",onfocus:"请输入链接名称",oncorrect:"输入正确"}).inputValidator({min:1,max:20,onerror:"请输入链接名称"});
	$("#url").formValidator({onshow:"请输入链接地址",onfocus:"请输入链接地址",oncorrect:"输入正确"}).regexValidator({regexp:"http://(.+)$",onerror:"格式应该为http://www.abc3210.com/，请以'/'结束"});
})
</script>
</head>
<body>
<div class="subnav">
  <div class="content-menu ib-a blue line-x"> <a href="{:U("Links/Links/index")}"><em>链接管理</em></a>
  <span>|</span><a href="{:U("Links/Links/add")}"  class="on"><em>添加链接</em></a></div>
</div>
<div class="pad_10">
  <div class="common-form">
    <form name="myform" action="" method="post" id="myform">
      <table width="100%" class="table_form contentWrap">
        <tbody>
        <tr>
          <td>链接名称</td>
          <td><input type="text" name="name" value="{$name}" class="input-text" id="name" size="30"></td>
        </tr>
        <tr>
          <td>地址</td>
          <td><input type="text" name="url" value="{$url}" class="input-text" id="url" size="30" style=" width:300px;"></td>
        </tr>
        <tr>
          <td>所属分类</td>
          <td>
          <select name="termsid">
            <option value="">==分类选择==</option>
            <volist name="Terms" id="vo">
            <option value="{$vo.id}" <if condition=" $vo[id] == $termsid "> selected</if>>{$vo.name}</option>
            </volist>
          </select> 创建新分类：<input type="text" name="terms[name]" value="" class="input-text" size="30"></td>
        </tr>
        <tr>
          <td>Logo</td>
          <td><?php echo Form::images('image', 'image', $image , 'content');?></td>
        </tr>
        <tr>
          <td>打开方式</td>
          <td>
          <select name="target">
            <option value="_self" <if condition=" $target == '_self' "> selected</if>>默认打开方式</option>
            <option value="_blank" <if condition=" $target == '_blank' "> selected</if>>新窗口打开</option>
          </select></td>
        </tr>
        <tr>
          <td>链接是否可见</td>
          <td>
          <select name="visible">
            <option value="1" <if condition=" $visible == '1' "> selected</if>>可见</option>
            <option value="0" <if condition=" $visible == '0' "> selected</if>>不可见</option>
          </select></td>
        </tr>
        <tr>
          <td>RSS地址</td>
          <td><input type="text" name="rss" value="{$rss}" class="input-text" id="rss" size="30" style=" width:300px;"></td>
        </tr>
        <tr>
          <td>链接描述</td>
          <td><textarea name="description" rows="2" cols="20" id="description" class="inputtext" style="height:100px;width:500px;">{$description}</textarea></td>
        </tr>
        <tr>
          <td>链接详细介绍</td>
          <td><textarea name="notes" rows="2" cols="20" id="notes" class="inputtext" style="width:700px;">{$notes}</textarea></td>
        </tr>
      </tbody>
      </table>
      <div class="bk15"></div>
      <input name="id" type="hidden" value="{$id}" />
      <input name="dosubmit" type="submit" value="提交" class="button" id="dosubmit">
    </form>
  </div>
</div>
<script type="text/javascript"  src="{$Config.siteurl}statics/js/ueditor/editor_config.js"></script>
<script type="text/javascript"  src="{$Config.siteurl}statics/js/ueditor/editor_all_min.js"></script>
<script type="text/javascript">
var editorcontent;
var editor_config_content = {
    textarea: 'notes',
    toolbars: [
        ['FullScreen', 'Source', '|', 'Undo', 'Redo', '|', 'Bold', 'Italic', 'Underline', 'Link', '|', 'InsertImage', 'SelectAll', 'ClearDoc', 'SearchReplace', 'Print', 'Preview', 'CheckImage','AutoTypeSet']
    ],
    minFrameHeight: 300
};
editorcontent = new baidu.editor.ui.Editor(editor_config_content);
editorcontent.render( 'notes' );
</script>
</body>
</html>